package com.eorchis.module.sysdeptuser.job;

import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.context.ApplicationContext;

import com.eorchis.core.log4j.ILog4jManager;
import com.eorchis.module.schedule.BaseJob;
import com.eorchis.module.schedule.annotation.Job;
import com.eorchis.module.sysdeptuser.domain.SysDepartmentBean;
import com.eorchis.module.sysdeptuser.service.impl.SysDeptUserServiceImpl;
import com.eorchis.module.sysdeptuser.ui.commond.SysDeptUserQueryCommond;

/**
 * 从UUM同步部委部门
 * Title: SysBuWeiDeptFromUUM<br>
 * Description: <br>
 * Copyright @ 2011~2016 Goldgov .All rights reserved.<br>
 * 
 * @author LongJZ
 * @createDate 2016-1-12
 * @version $Revision: $
 */
@Job(value = "sysBuWeiDeptFromUUM")
public class SysBuWeiDeptFromUUM extends BaseJob {

	@Override
	protected void executeJob(JobExecutionContext arg0, ApplicationContext arg1) throws JobExecutionException {
		SysDeptUserServiceImpl sysDeptUserService = (SysDeptUserServiceImpl) arg1.getBean("com.eorchis.module.sysdeptuser.service.impl.SysDeptUserServiceImpl");
		// 记录日志
		ILog4jManager log4jManager = (ILog4jManager) arg1.getBean("com.eorchis.core.log4j.impl.Log4jManager");
		log4jManager.debugCustomLog("com.eorchis.module.sysdeptuser.job.SysBuWeiDeptFromUUM", "execute", "从UUM同步部委部门");
		try {
			SysDeptUserQueryCommond queryCommond = new SysDeptUserQueryCommond();
			queryCommond.setQueryType(SysDepartmentBean.QUERY_TYPE);
			queryCommond.setSearchTreepath("-1/1/7390/");// 国务院各组成部委
			sysDeptUserService.sysDeptUser(queryCommond);
		} catch (Exception e) {
			e.printStackTrace();
		}
		log4jManager.debugCustomLog("com.eorchis.module.sysdeptuser.job.SysBuWeiDeptFromUUM", "execute", "从UUM同步部委部门");
	}

}
